﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;

namespace HolaMundoMVC4.Models
{
    public class LinkContenedor : DbContext
    {
        public LinkContenedor()
            : base("DefaultConnection") 
        {

        }

        public DbSet<Link> links { get; set; }

        public void agregarLink(Link link) 
        {
            // if (links == null) links = new List<Link>();
            link.fechaCreacion = DateTime.Now;
            links.Add(link);

            SaveChanges();
        }
         
    }
}